{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { getClientSize } from \"rc-util/es/Dom/css\";\nfunction fixPoint(key, start, width, clientWidth) {\n  var startAddWidth = start + width;\n  var offsetStart = (width - clientWidth) / 2;\n  if (width > clientWidth) {\n    if (start > 0) {\n      return _defineProperty({}, key, offsetStart);\n    }\n    if (start < 0 && startAddWidth < clientWidth) {\n      return _defineProperty({}, key, -offsetStart);\n    }\n  } else if (start < 0 || startAddWidth > clientWidth) {\n    return _defineProperty({}, key, start < 0 ? offsetStart : -offsetStart);\n  }\n  return {};\n}\n/**\n * Fix positon x,y point when\n *\n * Ele width && height < client\n * - Back origin\n *\n * - Ele width | height > clientWidth | clientHeight\n * - left | top > 0 -> Back 0\n * - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight\n *\n * Regardless of other\n */\n\nexport default function getFixScaleEleTransPosition(width, height, left, top) {\n  var _getClientSize = getClientSize(),\n    clientWidth = _getClientSize.width,\n    clientHeight = _getClientSize.height;\n  var fixPos = null;\n  if (width <= clientWidth && height <= clientHeight) {\n    fixPos = {\n      x: 0,\n      y: 0\n    };\n  } else if (width > clientWidth || height > clientHeight) {\n    fixPos = _objectSpread(_objectSpread({}, fixPoint('x', left, width, clientWidth)), fixPoint('y', top, height, clientHeight));\n  }\n  return fixPos;\n}","map":{"version":3,"names":["_objectSpread","_defineProperty","getClientSize","fixPoint","key","start","width","clientWidth","startAddWidth","offsetStart","getFixScaleEleTransPosition","height","left","top","_getClientSize","clientHeight","fixPos","x","y"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/rc-image/es/getFixScaleEleTransPosition.js"],"sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { getClientSize } from \"rc-util/es/Dom/css\";\n\nfunction fixPoint(key, start, width, clientWidth) {\n  var startAddWidth = start + width;\n  var offsetStart = (width - clientWidth) / 2;\n\n  if (width > clientWidth) {\n    if (start > 0) {\n      return _defineProperty({}, key, offsetStart);\n    }\n\n    if (start < 0 && startAddWidth < clientWidth) {\n      return _defineProperty({}, key, -offsetStart);\n    }\n  } else if (start < 0 || startAddWidth > clientWidth) {\n    return _defineProperty({}, key, start < 0 ? offsetStart : -offsetStart);\n  }\n\n  return {};\n}\n/**\n * Fix positon x,y point when\n *\n * Ele width && height < client\n * - Back origin\n *\n * - Ele width | height > clientWidth | clientHeight\n * - left | top > 0 -> Back 0\n * - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight\n *\n * Regardless of other\n */\n\n\nexport default function getFixScaleEleTransPosition(width, height, left, top) {\n  var _getClientSize = getClientSize(),\n      clientWidth = _getClientSize.width,\n      clientHeight = _getClientSize.height;\n\n  var fixPos = null;\n\n  if (width <= clientWidth && height <= clientHeight) {\n    fixPos = {\n      x: 0,\n      y: 0\n    };\n  } else if (width > clientWidth || height > clientHeight) {\n    fixPos = _objectSpread(_objectSpread({}, fixPoint('x', left, width, clientWidth)), fixPoint('y', top, height, clientHeight));\n  }\n\n  return fixPos;\n}"],"mappings":"AAAA,OAAOA,aAAa,MAAM,0CAA0C;AACpE,OAAOC,eAAe,MAAM,2CAA2C;AACvE,SAASC,aAAa,QAAQ,oBAAoB;AAElD,SAASC,QAAQ,CAACC,GAAG,EAAEC,KAAK,EAAEC,KAAK,EAAEC,WAAW,EAAE;EAChD,IAAIC,aAAa,GAAGH,KAAK,GAAGC,KAAK;EACjC,IAAIG,WAAW,GAAG,CAACH,KAAK,GAAGC,WAAW,IAAI,CAAC;EAE3C,IAAID,KAAK,GAAGC,WAAW,EAAE;IACvB,IAAIF,KAAK,GAAG,CAAC,EAAE;MACb,OAAOJ,eAAe,CAAC,CAAC,CAAC,EAAEG,GAAG,EAAEK,WAAW,CAAC;IAC9C;IAEA,IAAIJ,KAAK,GAAG,C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